import {  getInvoiceRevoke } from '@api/invoiceAdminister'
const batchDeleteEvent = {
  methods:{
    BatchDeleteDrafts(){
      const self = this
      // 代码实现  this.selectedRows
      const tempArr = this.selectedRowKeys
      if(this.$IS.isNullOrUnDef(tempArr) || this.$IS.isEmpty(tempArr)){
        this.$message.warning('请选择需要删除的数据')
        return false;
      }
      const params= {blInvcList: this.undeleteInfo.blInvcList,cancleInvcList:tempArr}
      this.$confirm({
        title: '确定要删除这些草稿吗？',
        content: '删除后将不能恢复，请慎重！',
        onOk() {
          return new Promise((resolve, reject) => {
            console.log('删除====》',tempArr);
            getInvoiceRevoke(params).then(res => {
              if (res.success) {
                self.getTableData();
              }else{
                self.$message.warning(res.message);
              }
              resolve()
            })
          }).catch(() => console.log('Oops errors!'));
        },
        onCancel() {
          console.log('取消删除====》',tempArr);
          self.$message.info('操作已取消');
        },
      });
    }
  }
}

export default batchDeleteEvent

